import requests
import account_api


def getOwner(house_id):
    """获取房东信息

    Args:
        house_id (_type_): _description_

    Returns:
        _type_: _description_
    """
    url = f'http://erp.fangline.cn/house/list-house-owner.json?houseId={house_id}'
    response = requests.post(url, headers=account_api.getHeaders())
    owners = response.json()
    owner = owners['ownerList'][0]
    return owner

def getOwner(house_id):
    """用户信息

    Args:
        house_id (_type_): _description_

    Returns:
        _type_: _description_
    """
    url = f'http://erp.fangline.cn/house/list-house-owner.json?houseId={house_id}'
    response = requests.post(url, headers=account_api.getHeaders())

    if response.status_code == 316:
        return ''

    return response.json()['ownerList']
